#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    bool isPalindrome(string s) {
        string a;
        for (char x : s)
        {
            if (isalnum(x))
            {
                a += tolower(x);
            }
        }

        string a_rev(a.rbegin(), a.rend());
        return a == a_rev;
    }
};